<?php
/**
 * @desc 个人之旅数据层
 * @author kevin.wang
 * @date 2015-01-01 12:00:00
 */
class PersonTravel extends Base
{
	//数据表
	protected $table = 'pert_person_travel';
	protected $gtable = 'pert_goods';
	//获取个人之旅数据
	public function getPtravel()  
    {
		 $table = $this->table;
		 $gtable = $this->gtable;
		 $filed = "a.`person_travel_id`,a.`goods_id`,a.`ptravel_keywords`,a.`transport`,a.`dinner`,a.`intro`,a.`ptravel_url`,a.`is_open`,b.`price`,b.`goods_sn`";
		 $sql = "select {$filed} from `{$table}` as a,`{$gtable}` as b where a.`goods_id`=b.`goods_id` and a.`delete_flag` = 0 and a.`is_show` = 0 order by a.`sort` desc, a.`person_travel_id` desc";
		 return $this->select_table($sql, array());
    }
	//处理数据
	public function handleData($data){
		$result = array();
		if(empty($data)){
			return $result;
		}
		foreach($data as $key=>$value){
			$value['ptravel_keywords'] = $this->hotWords($value['ptravel_keywords']);
			$result[] = $value;
		}
		return $result;
	}
}
